import { effect } from "./effect.js";
import { reactive } from "./reactive.js";

const s = new Set([1, 2, 3]);

const proxy = reactive(s);

const m = new Map([["foo", 1]]);

const mProxy = reactive(m);

const p2 = reactive(new Map());

// mProxy.set("p2", p2);

effect(() => {
  // mProxy.forEach((value, key, map) => {
  //   console.log(value);
  //   console.log(key);
  //   console.log(map);
  // });
  // console.log(mProxy.get("foo"));
  for (const value of mProxy.keys()) {
    // console.log(key);
    console.log(value);
  }
});

// mProxy.set("foo", 2);
// m.get("p2").set("foo", 2);
mProxy.set("foo", 3);
